<template>
	<view class="msgitem">
		<view class="msgitem__top">
			<view class="u-flex u-flex-y-center">
				<u-avatar :src="URL(item.avatar)" shape="circle" size="57rpx" mode="aspectFill"></u-avatar>
				<view class="msgitem__nickname">
					{{item.contract}}
				</view>
				<view class="msgitem__dqtime">
					{{$u.timeFormat(item.expiretime, 'yyyy-mm-dd')}}到期
				</view>
			</view>
			<!-- <view class="msgitem__tag" v-if="item.category_name">
				{{item.category_name}}
			</view>
			<view class="msgitem__tag" v-if="item.is_other==2">
				其他信息
			</view> -->
			
			<view class="msgitem__tag" @click="to('/pages/msg/fbdetail?title='+(item.category_name+'信息')+'&pid='+item.id)">
				查看详情
			</view>
		</view>
		<view class="msgitem__content">
			{{item.text}}
		</view>
		<view class="msgitem__piclist" v-if="item.imags.length>0">
			<u-album :urls="item.imags"></u-album>
		</view>
		<view class="u-flex u-flex-y-center u-flex-between">
			<view class="msgitem__time">
				<!-- {{item.createtime}} -->
				{{$u.timeFormat(item.createtime, 'yyyy-mm-dd hh:MM')}}
			</view>
			<view class="u-flex u-flex-y-center" v-if="status==1">
				<view class="" @click.stop="clickbtn(1)">
					<u-button text="拒绝通过" color="linear-gradient(90deg, #0484FC, #5D77FC)" :customStyle="{width:'fit-content',height:'73rpx'}" shape='circle'></u-button>
				</view>
				<view class="" @click.stop="clickbtn(2)" style="margin-left: 26rpx;">
					<u-button text="通过审核" color="linear-gradient(156deg, #03EA7A, #02C683)" :customStyle="{width:'fit-content',height:'73rpx'}" shape='circle'></u-button>
				</view>
			</view>
			<view class="u-flex u-flex-y-center" v-if="status==2">
				<u-button text="已通过审核" color="linear-gradient(156deg, #03EA7A, #02C683)" :customStyle="{width:'fit-content',height:'73rpx'}" shape='circle'></u-button>
			</view>
			<view class="u-flex u-flex-y-center" v-if="status==4">
				<u-button text="已拒绝通过" color="linear-gradient(90deg, #0484FC, #5D77FC)" :customStyle="{width:'fit-content',height:'73rpx'}" shape='circle'></u-button>
			</view>
			<!-- linear-gradient(90deg, #0484FC, #5D77FC) -->
			
		</view>
		<view class="msgitem__yy" v-if="item.status==4">
			<u-icon name="/static/my/gt.png" size="32rpx"></u-icon>
			<view class="msgitem__yy__text">
				失败原因:{{item.remark}}
			</view>
		</view>
	</view>
</template>

<script>
	import { BASE_URL } from '@/api/config';
	export default {
		name: "fbmsgitem",
		props: {
			item: {},
			status:{
				type:String,
				default:0
			}
		},
		data() {
			return {
				urls2: [],
				isdianz: false
			};
		},
		methods: {
			clickbtn(type) {
				if(type==1){//拒绝
					this.$emit('refuse')
				}
				if(type==2){//通过
					this.$emit('adopt')
				}
			}
		},
		onLoad() {
			
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #fff;
	}
	.msgitem {
		padding: 38rpx 20rpx 30rpx 30rpx;
		border-bottom: 2rpx solid #F4F6F8;

		&__dqtime {
			background: rgba(249, 109, 5, .12);
			border-radius: 10rpx;
			padding: 0 12rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #F86503;
			line-height: 43rpx;
		}

		&__top {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding-right: 10rpx;

			/deep/.u-icon--right {
				margin-right: 10rpx;
				.u-icon__img{
					width: 23rpx!important;
					height: 24rpx!important;
				}
				
			}
		}

		&__nickname {
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 26rpx;
			color: #5A5A5A;
			line-height: 26rpx;
			margin: 0 8rpx;
		}

		&__tag {
			padding: 0 12rpx;
			height: 53rpx;
			background: #0384FC;
			border-radius: 8rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 25rpx;
			color: #4E4D52;
			line-height: 53rpx;
			color: #fff;
			margin-left: 16rpx;
		}

		&__content {
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 30rpx;
			color: #2C2A2A;
			line-height: 40rpx;
			padding: 14rpx 0 20rpx;
		}

		&__piclist {
			margin-bottom: 40rpx;
		}

		&__time {
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 24rpx;
			color: #5A5A5A;
			line-height: 24rpx;
		}

		&__num {
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 24rpx;
			color: #3C3C3C;
			line-height: 24rpx;
			margin: 0 50rpx 0 12rpx;
		}
		&__yy{
			display: flex;
			align-items: center;
			padding: 30rpx 18rpx;
			background: #F7F7F9;
			border-radius: 15rpx;
			margin-top: 20rpx;
			&__text{
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 26rpx;
				color: #1E1E1E;
				line-height: 36rpx;
				margin-left: 9rpx;
			}
		}
	}

	/deep/.u-album__row__wrapper {}
</style>